Project_V1

Code
suppressPackageStartupMessages(library(readxl))
suppressPackageStartupMessages(library(tidyverse))
suppressPackageStartupMessages(library(plotly))
suppressPackageStartupMessages(library(fmsb))

data = read_excel("Project_1_Data.xlsx", sheet = "pooled123")

filteredData = select(data, Date, PID, BSSQ_1:BSSQ_16, ASSQ_1:ASSQ_16, age, VRexperience, ssq_full, gender, sm)
#we only want to look at those that did not undergo social modelling conditions
filteredData = subset(filteredData, sm == "NO_SM")

#reclasss VR experience as factor (was chr)
filteredData$VRexperience = as.factor(filteredData$VRexperience)

#we want to filter this data even further and split it into age groups
#once in age groups, calculate the mean change for each of the age groups for each symptom
filteredData = mutate(filteredData, age_group = case_when(
  age > 45 ~ "above 45",
  age >= 38 ~ "38 to 45",
  age >= 30 ~ "30 to 37",
  age >= 22 ~ "22 to 29",
  age >= 16 ~ "16 to 21"
))

symptoms = c("discomfort",
                "fatigue", 
                "headache",
                "eyestrain",
                "difficulty_focusing",
                "salivation",
                "sweating",
                "nausea",
                "difficulty_concentrating",
                "fullness_of_head",
                "blurred_vision",
                "dizziness_o",
                "dizziness_c",
                "vertigo",
                "stomach_awareness",
                "burping")

for (i in 1:length(symptoms)) {
  filteredData[[paste0("d_", symptoms[[i]])]] <- filteredData[[paste0("ASSQ_", i)]] - filteredData[[paste0("BSSQ_", i)]]
} # Borna's friend made fun of us for doing this manually so we got chatGPT to fix it

yes_means_vector <- numeric(length(symptoms))
no_means_vector = numeric(length(symptoms))

# Loop through symptoms and calculate the mean for each one
for (i in 1:length(symptoms)) {
  # Calculate the mean for the current symptom column
  yes_means_vector[i] <- mean(filter(filteredData, VRexperience == "Yes")[[paste0("d_", symptoms[i])]])
  no_means_vector[i] <- mean(filter(filteredData, VRexperience == "No")[[paste0("d_", symptoms[i])]])
}

# Create a data frame from the vector
means_per_symptom <- data.frame(symptom = symptoms, yes_mean_value = yes_means_vector, no_means_value = no_means_vector)
Code
#calculating differences between baseline and active SSQ for each symptom
filteredData = mutate(filteredData, d_discomfort = ASSQ_1 - BSSQ_1)
filteredData = mutate(filteredData, d_fatigue = ASSQ_2 - BSSQ_2)
filteredData = mutate(filteredData, d_headache = ASSQ_3 - BSSQ_3)
filteredData = mutate(filteredData, d_eyestrain = ASSQ_4 - BSSQ_4)
filteredData = mutate(filteredData, d_difficulty_focusing = ASSQ_5 - BSSQ_5)
filteredData = mutate(filteredData, d_salivation = ASSQ_6 - BSSQ_6)
filteredData = mutate(filteredData, d_sweating = ASSQ_7 - BSSQ_7)
filteredData = mutate(filteredData, d_nausea = ASSQ_8 - BSSQ_8)
filteredData = mutate(filteredData, d_difficulty_concentrating = ASSQ_9 - BSSQ_9)
filteredData = mutate(filteredData, d_fullness_of_head = ASSQ_10 - BSSQ_10)
filteredData = mutate(filteredData, d_blurred_vision = ASSQ_11 - BSSQ_11)
filteredData = mutate(filteredData, d_dizziness_o = ASSQ_12 - BSSQ_12)
filteredData = mutate(filteredData, d_dizziness_c = ASSQ_13 - BSSQ_13)
filteredData = mutate(filteredData, d_vertigo = ASSQ_14 - BSSQ_14)
filteredData = mutate(filteredData, d_stomach_awareness = ASSQ_15 - BSSQ_15)
filteredData = mutate(filteredData, d_burping = ASSQ_16 - BSSQ_16)

#convert the age groups into factors
#filteredData$age_group = as.factor(filteredData$age_group)

#renaming columns to be more informative
names(filteredData)[names(filteredData) == 'BSSQ_1'] <- 'BSSQ_discomfort'
names(filteredData)[names(filteredData) == 'BSSQ_2'] <- 'BSSQ_fatigue'
names(filteredData)[names(filteredData) == 'BSSQ_3'] <- 'BSSQ_headache'
names(filteredData)[names(filteredData) == 'BSSQ_4'] <- 'BSSQ_eyestrain'
names(filteredData)[names(filteredData) == 'BSSQ_5'] <- 'BSSQ_difficulty_focusing'
names(filteredData)[names(filteredData) == 'BSSQ_6'] <- 'BSSQ_salivation'
names(filteredData)[names(filteredData) == 'BSSQ_7'] <- 'BSSQ_sweating'
names(filteredData)[names(filteredData) == 'BSSQ_8'] <- 'BSSQ_nausea'
names(filteredData)[names(filteredData) == 'BSSQ_9'] <- 'BSSQ_difficulty_concentrating'
names(filteredData)[names(filteredData) == 'BSSQ_10'] <- 'BSSQ_fullness_of_head'
names(filteredData)[names(filteredData) == 'BSSQ_11'] <- 'BSSQ_blurred_vision'
names(filteredData)[names(filteredData) == 'BSSQ_12'] <- 'BSSQ_dizziness_o'
names(filteredData)[names(filteredData) == 'BSSQ_13'] <- 'BSSQ_dizziness_c'
names(filteredData)[names(filteredData) == 'BSSQ_14'] <- 'BSSQ_vertigo'
names(filteredData)[names(filteredData) == 'BSSQ_15'] <- 'BSSQ_stomach_awareness'
names(filteredData)[names(filteredData) == 'BSSQ_16'] <- 'BSSQ_burping'


names(filteredData)[names(filteredData) == 'ASSQ_1'] <- 'ASSQ_discomfort'
names(filteredData)[names(filteredData) == 'ASSQ_2'] <- 'ASSQ_fatigue'
names(filteredData)[names(filteredData) == 'ASSQ_3'] <- 'ASSQ_headache'
names(filteredData)[names(filteredData) == 'ASSQ_4'] <- 'ASSQ_eyestrain'
names(filteredData)[names(filteredData) == 'ASSQ_5'] <- 'ASSQ_difficulty_focusing'
names(filteredData)[names(filteredData) == 'ASSQ_6'] <- 'ASSQ_salivation'
names(filteredData)[names(filteredData) == 'ASSQ_7'] <- 'ASSQ_sweating'
names(filteredData)[names(filteredData) == 'ASSQ_8'] <- 'ASSQ_nausea'
names(filteredData)[names(filteredData) == 'ASSQ_9'] <- 'ASSQ_difficulty_concentrating'
names(filteredData)[names(filteredData) == 'ASSQ_10'] <- 'ASSQ_fullness_of_head'
names(filteredData)[names(filteredData) == 'ASSQ_11'] <- 'ASSQ_blurred_vision'
names(filteredData)[names(filteredData) == 'ASSQ_12'] <- 'ASSQ_dizziness_o'
names(filteredData)[names(filteredData) == 'ASSQ_13'] <- 'ASSQ_dizziness_c'
names(filteredData)[names(filteredData) == 'ASSQ_14'] <- 'ASSQ_vertigo'
names(filteredData)[names(filteredData) == 'ASSQ_15'] <- 'ASSQ_stomach_awareness'
names(filteredData)[names(filteredData) == 'ASSQ_16'] <- 'ASSQ_burping'


#isolating the data dictionary
data_dict = read_excel("Project_1_Data.xlsx", sheet = "data_dictionary")

#filter into groups with experience or not
withVRexperience = filter(filteredData, VRexperience == 'Yes')
noVRexperience = filter(filteredData, VRexperience == 'No')

#taking averages for with/without experience
yes_avg_d_discomfort = mean(withVRexperience$d_discomfort)
yes_avg_d_fatigue = mean(withVRexperience$d_fatigue)
yes_avg_d_headache = mean(withVRexperience$d_headache)
yes_avg_d_eyestrain = mean(withVRexperience$d_eyestrain)
yes_avg_d_difficulty_focusing = mean(withVRexperience$d_difficulty_focusing)
yes_avg_d_salivation = mean(withVRexperience$d_salivation)
yes_avg_d_sweating = mean(withVRexperience$d_sweating)
yes_avg_d_nausea = mean(withVRexperience$d_nausea)
yes_avg_d_difficulty_concentrating = mean(withVRexperience$d_difficulty_concentrating)
yes_avg_d_fullness = mean(withVRexperience$d_fullness_of_head)
yes_avg_d_vision = mean(withVRexperience$d_blurred_vision)
yes_avg_d_dizziness_o = mean(withVRexperience$d_dizziness_o)
yes_avg_d_dizziness_c = mean(withVRexperience$d_dizziness_c)
yes_avg_d_vertigo = mean(withVRexperience$d_vertigo)
yes_avg_d_stomach = mean(withVRexperience$d_stomach_awareness)
yes_avg_d_burping = mean(withVRexperience$d_burping)


no_avg_d_discomfort = mean(noVRexperience$d_discomfort)
no_avg_d_fatigue = mean(noVRexperience$d_fatigue)
no_avg_d_headache = mean(noVRexperience$d_headache)
no_avg_d_eyestrain = mean(noVRexperience$d_eyestrain)
no_avg_d_difficulty_focusing = mean(noVRexperience$d_difficulty_focusing)
no_avg_d_salivation = mean(noVRexperience$d_salivation)
no_avg_d_sweating = mean(noVRexperience$d_sweating)
no_avg_d_nausea = mean(noVRexperience$d_nausea)
no_avg_d_difficulty_concentrating = mean(noVRexperience$d_difficulty_concentrating)
no_avg_d_fullness = mean(noVRexperience$d_fullness_of_head)
no_avg_d_vision = mean(noVRexperience$d_blurred_vision)
no_avg_d_dizziness_o = mean(noVRexperience$d_dizziness_o)
no_avg_d_dizziness_c = mean(noVRexperience$d_dizziness_c)
no_avg_d_vertigo = mean(noVRexperience$d_vertigo)
no_avg_d_stomach = mean(noVRexperience$d_stomach_awareness)
no_avg_d_burping = mean(noVRexperience$d_burping)


#taking averages for different age groups
grp1 = filter(filteredData, age_group == '16 to 21')
grp2 = filter(filteredData, age_group == '22 to 29')
grp3 = filter(filteredData, age_group == '30 to 37')
grp4 = filter(filteredData, age_group == '38 to 45')
grp5 = filter(filteredData, age_group == 'above 45')

mean_sqq_ages = c(mean(grp1$ssq_full),
                  mean(grp2$ssq_full),
                  mean(grp3$ssq_full),
                  mean(grp4$ssq_full),
                  mean(grp5$ssq_full)
                  )

data_by_age_group = data.frame(
  age_group = c("16 to 21", '22 to 29','30 to 37','38 to 45','Above 45'),
  mean_ssq = mean_sqq_ages
  
)

filteredData = mutate(filteredData, "generation" = case_when(year(Date) - age >= 2010 ~ "a", year(Date) - age >= 1997 ~ "Z", year(Date) - age >= 1981 ~ "Y", year(Date) - age >= 1965 ~ "X", TRUE ~ "Old"))

Summary of Findings

(executive summary goes here)

Initial Data Analysis (IDA)

Source

Our data was sourced from Cosette Saunder’s paper “Socially Acquired Nocebo Effects Generalize but Are Not Attenuated by Choice”.

Structure

We specifically looked at participants that did not undego any social modelling; 69 participants, each with 51 variables recorded. Our project focused the following variables:

  • Baseline SSQ (BSSQ), Active SSQ (ASSQ), and SSQ_Fullof 16 symptoms (quantitative, discrete): self-reported symptom severity before and after undergoing VR respectively, on a scale of 1 to 10.

  • Participants’ VRexperience (qualitative, nominal); sorted by experience to see how symptoms differed.

  • age of participants (quantitative, discrete); they were then sorted into age groups.

  • The change (\(\Delta\)) between BSSQ and ASSQ was calculated for each participant for each symptom, and we took the average \(\Delta\) for each symptom for each group (VRexperience and age_group) (quantitative, discrete).

Code
data_age_groups = select(filteredData, age_group)
groups_counted = data_age_groups %>% count(age_group)

age_pie = plot_ly(groups_counted, labels = ~age_group, values = ~n,
                 type = 'pie', direction = 'clockwise', sort = FALSE, rotation = 30)
age_pie <- age_pie %>% layout(title = 'Distribution of ages',
                            showlegend = TRUE)
age_pie
<<<<<<< HEAD
=======
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e
Code
data_experience = select(filteredData, VRexperience)
exp_counted = data_experience %>% count(VRexperience)

vr_pie = plot_ly(exp_counted, labels = ~VRexperience, values = ~n,
                 type = 'pie')
vr_pie <- vr_pie %>% layout(title = 'Distribution of VR experience',
                            showlegend = TRUE)

vr_pie
<<<<<<< HEAD
=======
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e

Limitations

  • Self-reporting bias for both BSSQ and ASSQ which makes the values prone to being over or underestimates by each participant.

  • VRexperience is a binary qualitative classification, it is not descriptive of the nature, amount or frequency, and that those with more than 10 VR experiences were excluded.

Research Question

What is the effect of past VR experience on the symptoms experienced by people?

Code <<<<<<< HEAD
library(plotly)



yes_means = c(yes_avg_d_discomfort,
              yes_avg_d_fatigue,
              yes_avg_d_headache,
              yes_avg_d_eyestrain,
              yes_avg_d_sweating,
              yes_avg_d_nausea,
              yes_avg_d_dizziness_c,
              yes_avg_d_dizziness_o,
              yes_avg_d_difficulty_focusing,
              yes_avg_d_difficulty_concentrating,
              yes_avg_d_salivation,
              yes_avg_d_vision,
              yes_avg_d_vertigo,
              yes_avg_d_stomach,
              yes_avg_d_fullness,
              yes_avg_d_burping
              )

no_means = c(no_avg_d_discomfort,
             no_avg_d_fatigue,
             no_avg_d_headache,
             no_avg_d_eyestrain,
             no_avg_d_sweating,
             no_avg_d_nausea,
             no_avg_d_dizziness_c,
             no_avg_d_dizziness_o,
             no_avg_d_difficulty_focusing,
             no_avg_d_difficulty_concentrating,
             no_avg_d_salivation,
             no_avg_d_vision,
             no_avg_d_vertigo,
             no_avg_d_stomach,
             no_avg_d_fullness,
             no_avg_d_burping
             )

yes_means
 [1]  1.2702703 -0.4594595  0.6756757  0.6486486  0.4054054  0.8918919
 [7]  0.8918919  0.6756757  0.4054054  0.2702703  0.1891892  0.0000000
[13]  1.1081081  0.7837838  0.8918919  0.2702703
Code
no_means
 [1]  0.46875 -0.53125  0.06250 -0.06250  0.28125  0.31250  0.18750  0.15625
 [9] -0.06250 -0.12500  0.18750  0.00000  0.53125  0.06250  0.34375  0.18750
Code
means_per_symptom
                    symptom yes_mean_value no_means_value
1                discomfort      1.2702703        0.46875
2                   fatigue     -0.4594595       -0.53125
3                  headache      0.6756757        0.06250
4                 eyestrain      0.6486486       -0.06250
5       difficulty_focusing      0.4054054       -0.06250
6                salivation      0.1891892        0.18750
7                  sweating      0.4054054        0.28125
8                    nausea      0.8918919        0.31250
9  difficulty_concentrating      0.2702703       -0.12500
10         fullness_of_head      0.8918919        0.34375
11           blurred_vision      0.0000000        0.00000
12              dizziness_o      0.6756757        0.15625
13              dizziness_c      0.8918919        0.18750
14                  vertigo      1.1081081        0.53125
15        stomach_awareness      0.7837838        0.06250
16                  burping      0.2702703        0.18750
Code
fig <- plot_ly(
  type  = 'scatterpolar',
  fill = 'toself',
  title = "Average change in BSSQ and ASSQ depending on VR experience for each symptom"
)

fig <- fig %>% 
  add_trace(
    r = means_per_symptom$yes_mean_value,
    theta = c('Discomfort', 'Fatigue', 'Headache', 'Eyestrain', 'Sweating', 'Nausea', 'Dizziness (closed)', 'Dizziness (open)', 'Difficulty Focusing', 'Difficulty Concentrating', 'Salivation', 'Blurry Vision', 'Vertigo', 'Stomach Awareness', 'Fullness of head','Burping'),
    name = 'With VR Experience'
  )

fig <- fig %>% 
  add_trace(
    r = means_per_symptom$no_means_value,
    theta = c('Discomfort', 'Fatigue', 'Headache', 'Eyestrain', 'Sweating', 'Nausea','Dizziness (closed)', 'Dizziness (open)', 'Difficulty Focusing', 'Difficulty Concentrating', 'Salivation', 'Blurry Vision',  'Vertigo', 'Stomach Awareness', 'Fullness of head','Burping'),
    name = 'No VR Experience'
  )

fig <- fig %>%
  layout(
    polar = list(
      radialaxis = list(
        visible = T,
        range = c(-0.5,2)
      )
    ),
    showlegend = T
  )

fig
=======
plt = ggplot(filteredData, aes(x = VRexperience, y = ssq_full, fill = VRexperience)) +
  geom_boxplot() +
  theme_minimal() +
  labs(x = "VR Experience", y = "Full SSQ")
ggplotly(plt)
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e

Those with and without VR experience reported varied severity of symptoms. Interestingly, the VR experienced group saw a greater median ssq_full, at 7.0 compared to -0.5 for those without experience, indicating those with experience reported more severe symptoms afterwards. VR experienced participants also showed a greater IQR than those without, at 16.25 and 8.5 respectively, pointing to experienced users reporting less consistent symptom severity.

Code <<<<<<< HEAD
library(tidyverse)
library(plotly)

plt = ggplot(filteredData, aes(x = as.factor(gender) , y = ssq_full, group = VRexperience, fill = VRexperience)) +
  geom_boxplot(position = "dodge") +
  labs(x = "gender",  y = "Full SSQ")
plt
=======
library(plotly)

yes_means = c(yes_avg_d_discomfort,
              yes_avg_d_fatigue,
              yes_avg_d_headache,
              yes_avg_d_eyestrain,
              yes_avg_d_sweating,
              yes_avg_d_nausea,
              yes_avg_d_dizziness_c,
              yes_avg_d_dizziness_o,
              yes_avg_d_difficulty_focusing,
              yes_avg_d_difficulty_concentrating,
              yes_avg_d_salivation,
              yes_avg_d_vision,
              yes_avg_d_vertigo,
              yes_avg_d_stomach,
              yes_avg_d_fullness,
              yes_avg_d_burping
              )

no_means = c(no_avg_d_discomfort,
             no_avg_d_fatigue,
             no_avg_d_headache,
             no_avg_d_eyestrain,
             no_avg_d_sweating,
             no_avg_d_nausea,
             no_avg_d_dizziness_c,
             no_avg_d_dizziness_o,
             no_avg_d_difficulty_focusing,
             no_avg_d_difficulty_concentrating,
             no_avg_d_salivation,
             no_avg_d_vision,
             no_avg_d_vertigo,
             no_avg_d_stomach,
             no_avg_d_fullness,
             no_avg_d_burping
             )

fig <- plot_ly(
  type  = 'scatterpolar',
  fill = 'toself',
  title = "Average change in BSSQ and ASSQ depending on VR experience for each symptom"
)

fig <- fig %>% 
  add_trace(
    r = yes_means,
    theta = c('Discomfort', 'Fatigue', 'Headache', 'Eyestrain', 'Sweating', 'Nausea', 'Dizziness (closed)', 'Dizziness (open)', 'Difficulty Focusing', 'Difficulty Concentrating', 'Salivation', 'Blurry Vision', 'Vertigo', 'Stomach Awareness', 'Fullness of head','Burping'),
    name = 'With VR Experience'
  )

fig <- fig %>% 
  add_trace(
    r = no_means,
    theta = c('Discomfort', 'Fatigue', 'Headache', 'Eyestrain', 'Sweating', 'Nausea','Dizziness (closed)', 'Dizziness (open)', 'Difficulty Focusing', 'Difficulty Concentrating', 'Salivation', 'Blurry Vision',  'Vertigo', 'Stomach Awareness', 'Fullness of head','Burping'),
    name = 'No VR Experience'
  )

fig <- fig %>%
  layout(
    polar = list(
      radialaxis = list(
        visible = T,
        range = c(-0.5,2)
      )
    ),
    showlegend = T
  )

fig

The spider-chart above reinforces what we see in the box-plot, with VR experienced users all indicating a higher average \(\Delta\) for almost all of the 16 symptoms.

These observations are in contrast to [insert article(s) here]

Code
ggplot(filteredData) +
  geom_boxplot(aes(x = "Discomfort", y = d_discomfort, fill = VRexperience)) +
  geom_boxplot(aes(x = "Fatigue", y = d_fatigue, fill = VRexperience)) +
  geom_boxplot(aes(x = "Headache", y = d_headache, fill = VRexperience)) +
  geom_boxplot(aes(x = "Eyestrain", y = d_eyestrain, fill = VRexperience)) +
  geom_boxplot(aes(x = "Difficulty Focusing", y = d_difficulty_focusing, fill = VRexperience)) +
  geom_boxplot(aes(x = "Salivation", y = d_salivation, fill = VRexperience)) +
  geom_boxplot(aes(x = "Sweating", y = d_sweating, fill = VRexperience)) +
  geom_boxplot(aes(x = "Nausea", y = d_nausea, fill = VRexperience)) +
  geom_boxplot(aes(x = "Difficulty Concentrating", y = d_difficulty_concentrating, fill = VRexperience)) +
  geom_boxplot(aes(x = "Fullness of Head", y = d_fullness_of_head, fill = VRexperience)) +
  geom_boxplot(aes(x = "Blurred Vision", y = d_blurred_vision, fill = VRexperience)) +
  geom_boxplot(aes(x = "Dizziness (o)", y = d_dizziness_o, fill = VRexperience)) +
  geom_boxplot(aes(x = "Dizziness (c)", y = d_dizziness_c, fill = VRexperience)) +
  geom_boxplot(aes(x = "Vertigo", y = d_vertigo, fill = VRexperience)) +
  geom_boxplot(aes(x = "Stomach Awareness", y = d_stomach_awareness, fill = VRexperience)) +
  theme_minimal() +
  labs(title = "VR Experience and Symptom Change",
       x = "Symptom",
       y = "Change in Severity") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e

Code
library(tidyverse)
library(plotly)

plt = ggplot(filteredData, aes(x = as.factor(gender) , y = ssq_full, group = VRexperience, fill = VRexperience)) +
  geom_boxplot(position = "dodge") +
  labs(x = "gender",  y = "Full SSQ")
plt

Code <<<<<<< HEAD
ggplotly(plt) %>%  layout(boxmode = "group")
=======
ggplotly(plt) %>%  layout(boxmode = "group")
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e
Warning: 'layout' objects don't have these attributes: 'boxmode'
Valid attributes include:
'_deprecated', 'activeshape', 'annotations', 'autosize', 'autotypenumbers', 'calendar', 'clickmode', 'coloraxis', 'colorscale', 'colorway', 'computed', 'datarevision', 'dragmode', 'editrevision', 'editType', 'font', 'geo', 'grid', 'height', 'hidesources', 'hoverdistance', 'hoverlabel', 'hovermode', 'images', 'legend', 'mapbox', 'margin', 'meta', 'metasrc', 'modebar', 'newshape', 'paper_bgcolor', 'plot_bgcolor', 'polar', 'scene', 'selectdirection', 'selectionrevision', 'separators', 'shapes', 'showlegend', 'sliders', 'smith', 'spikedistance', 'template', 'ternary', 'title', 'transition', 'uirevision', 'uniformtext', 'updatemenus', 'width', 'xaxis', 'yaxis', 'barmode', 'bargap', 'mapType'
<<<<<<< HEAD
=======
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e
Code <<<<<<< HEAD
library(tidyverse)
library(plotly)

plt = ggplot(filteredData, aes(x = VRexperience, y = d_dizziness_c)) +
  geom_boxplot() +
  labs(x = "VR Experience",  y = "Change in BSSQ and ASSQ-Dizziness (Eyes Closed)")

ggplotly(plt)
Code
#fivenum(withVRexperience$d_dizziness_c)
#fivenum(noVRexperience$d_dizziness_c)
#
#mean(withVRexperience$d_dizziness_c)
#mean(noVRexperience$d_dizziness_c)
#
#sd(withVRexperience$d_dizziness_c)
#sd(noVRexperience$d_dizziness_c)


#since from the boxplots we can see that both sets have a fair number of outliers which could affect the mean, the median + IQR may be a better measure of spread
=======
library(tidyverse)
library(plotly)

plt = ggplot(filteredData, aes(x = VRexperience, y = d_dizziness_c)) +
  geom_boxplot() +
  labs(x = "VR Experience",  y = "Change in BSSQ and ASSQ-Dizziness (Eyes Closed)")

ggplotly(plt)
Code
#fivenum(withVRexperience$d_dizziness_c)
#fivenum(noVRexperience$d_dizziness_c)
#
#mean(withVRexperience$d_dizziness_c)
#mean(noVRexperience$d_dizziness_c)
#
#sd(withVRexperience$d_dizziness_c)
#sd(noVRexperience$d_dizziness_c)


#since from the boxplots we can see that both sets have a fair number of outliers which could affect the mean, the median + IQR may be a better measure of spread
Code
library(tidyverse)
library(plotly)
library(gganimate)
library(gifski)

plt = ggplot(filteredData, aes(y = d_dizziness_c, x = age, colour = VRexperience)) +
  geom_point() +
  labs(x = "Age",  y = "Dizziness (Eyes Closed)", col = "VR Experience") +
  transition_states(VRexperience, transition_length = 1, state_length = 1) +
  enter_fade() + exit_fade()

#animate(plt, renderer = gifski_renderer())
ggplotly(plt)
Code
library(tidyverse)
library(plotly)

plt = ggplot(filteredData, aes(x = age_group, y = d_dizziness_c)) +
  geom_boxplot() +
  labs(x = "Age Group",  y = "Change in BSSQ and ASSQ-Dizziness(Eyes Closed)")

ggplotly(plt)
Code
library(tidyverse)
library(plotly)

plt = ggplot(filteredData, aes(x = VRexperience, y = d_vertigo)) +
  geom_boxplot() +
  labs(x = "VR Experience",  y = "Vertigo")

ggplotly(plt)
Code
#fivenum(withVRexperience$d_vertigo)
#fivenum(noVRexperience$d_vertigo)
#
#mean(withVRexperience$d_vertigo)
#mean(noVRexperience$d_vertigo)
#
#sd(withVRexperience$d_vertigo)
#sd(noVRexperience$d_vertigo)
Code
library(tidyverse)
library(plotly)

plt = ggplot(filteredData, aes(x = age_group, y = d_vertigo)) +
  geom_boxplot() +
  labs(x = "Age Group",  y = "Change in BSSQ and ASSQ - Vertigo")

ggplotly(plt)
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e
Code
library(tidyverse)
library(plotly)
library(gganimate)
library(gifski)

<<<<<<< HEAD
plt = ggplot(filteredData, aes(y = d_dizziness_c, x = age, colour = VRexperience)) +
  geom_point() +
  labs(x = "Age",  y = "Dizziness (Eyes Closed)", col = "VR Experience") +
=======
plt = ggplot(filteredData, aes(y = d_vertigo, x = age, colour = VRexperience)) +
  geom_point() +
  labs(x = "Age",  y = "Vertigo", col = "VR Experience") +
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e
  transition_states(VRexperience, transition_length = 1, state_length = 1) +
  enter_fade() + exit_fade()

#animate(plt, renderer = gifski_renderer())
ggplotly(plt)
<<<<<<< HEAD
=======
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e
Code
library(tidyverse)
library(plotly)

<<<<<<< HEAD
plt = ggplot(filteredData, aes(x = age_group, y = d_dizziness_c)) +
  geom_boxplot() +
  labs(x = "Age Group",  y = "Change in BSSQ and ASSQ-Dizziness(Eyes Closed)")
=======
plt = ggplot(filteredData, aes(x = VRexperience, y = d_stomach_awareness)) +
  geom_boxplot() +
  labs(x = "VR Experience",  y = "Change in BSSQ and ASSQ - Stomach Awareness")
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e

ggplotly(plt)
<<<<<<< HEAD
=======
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e
Code
library(tidyverse)
library(plotly)

<<<<<<< HEAD
plt = ggplot(filteredData, aes(x = VRexperience, y = d_vertigo)) +
  geom_boxplot() +
  labs(x = "VR Experience",  y = "Vertigo")
=======
plt = ggplot(filteredData, aes(x = age_group, y = d_stomach_awareness)) +
  geom_boxplot() +
  labs(x = "Age Group",  y = "Change in BSSQ and ASSQ - Stomach Awareness")
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e

ggplotly(plt)
<<<<<<< HEAD
Code
#fivenum(withVRexperience$d_vertigo)
#fivenum(noVRexperience$d_vertigo)
#
#mean(withVRexperience$d_vertigo)
#mean(noVRexperience$d_vertigo)
#
#sd(withVRexperience$d_vertigo)
#sd(noVRexperience$d_vertigo)
Code
library(tidyverse)
library(plotly)

plt = ggplot(filteredData, aes(x = age_group, y = d_vertigo)) +
  geom_boxplot() +
  labs(x = "Age Group",  y = "Change in BSSQ and ASSQ - Vertigo")

ggplotly(plt)
=======
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e
Code <<<<<<< HEAD
library(tidyverse)
library(plotly)
library(gganimate)
library(gifski)

plt = ggplot(filteredData, aes(y = d_vertigo, x = age, colour = VRexperience)) +
  geom_point() +
  labs(x = "Age",  y = "Vertigo", col = "VR Experience") +
  transition_states(VRexperience, transition_length = 1, state_length = 1) +
  enter_fade() + exit_fade()

#animate(plt, renderer = gifski_renderer())
ggplotly(plt)
Code
library(tidyverse)
library(plotly)

plt = ggplot(filteredData, aes(x = VRexperience, y = d_stomach_awareness)) +
  geom_boxplot() +
  labs(x = "VR Experience",  y = "Change in BSSQ and ASSQ - Stomach Awareness")

ggplotly(plt)
Code
library(tidyverse)
library(plotly)

plt = ggplot(filteredData, aes(x = age_group, y = d_stomach_awareness)) +
  geom_boxplot() +
  labs(x = "Age Group",  y = "Change in BSSQ and ASSQ - Stomach Awareness")

ggplotly(plt)
Code
library(tidyverse)
library(plotly)
library(gganimate)
library(gifski)

plt = ggplot(filteredData, aes(y = d_stomach_awareness, x = age, colour = VRexperience)) +
  geom_point() +
  labs(x = "Age",  y = "Stomach Awareness", col = "VR Experience") +
  transition_states(VRexperience, transition_length = 1, state_length = 1) +
  enter_fade() + exit_fade()

#animate(plt, renderer = gifski_renderer())
ggplotly(plt)
=======
library(tidyverse)
library(plotly)
library(gganimate)
library(gifski)

plt = ggplot(filteredData, aes(y = d_stomach_awareness, x = age, colour = VRexperience)) +
  geom_point() +
  labs(x = "Age",  y = "Stomach Awareness", col = "VR Experience") +
  transition_states(VRexperience, transition_length = 1, state_length = 1) +
  enter_fade() + exit_fade()

#animate(plt, renderer = gifski_renderer())
ggplotly(plt)
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e
Code <<<<<<< HEAD
library(plotly)
library(tidyselect)

mean_sqq_ages = c(mean(grp1$ssq_full),
                  mean(grp2$ssq_full),
                  mean(grp3$ssq_full),
                  mean(grp4$ssq_full),
                  mean(grp5$ssq_full)
                  )

fig2 <- plot_ly(
  type = 'scatterpolar',
  fill = 'toself',
  r = mean_sqq_ages,
  theta = c("16 to 21",
            "22 to 29",
            "30 to 37",
            "38 to 45",
            "above 45")
)
fig2 <- fig2 %>%
  layout(
    polar = list(
      radialaxis = list(
        visible = T,
        range = c(0,20)
      )
    ),
    showlegend = T
  )

fig2
=======
library(plotly)
library(tidyselect)

mean_sqq_ages = c(mean(grp1$ssq_full),
                  mean(grp2$ssq_full),
                  mean(grp3$ssq_full),
                  mean(grp4$ssq_full),
                  mean(grp5$ssq_full)
                  )

fig2 <- plot_ly(
  type = 'scatterpolar',
  fill = 'toself',
  r = mean_sqq_ages,
  theta = c("16 to 21",
            "22 to 29",
            "30 to 37",
            "38 to 45",
            "above 45")
)
fig2 <- fig2 %>%
  layout(
    polar = list(
      radialaxis = list(
        visible = T,
        range = c(0,20)
      )
    ),
    showlegend = T
  )

fig2
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e
No scatterpolar mode specifed:
  Setting the mode to markers
  Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
<<<<<<< HEAD
Code
fig3 = ggplot(data_by_age_group, aes(x = age_group, y = mean_ssq)) +
  geom_bar(stat = 'identity')



ggplotly(fig3)
Code
library(tidyverse)

p = ggplot(filteredData, aes(x = age, y = ssq_full, colour = VRexperience)) +
  geom_point()

p

Code
plt = ggplot(filteredData, aes(x = VRexperience, y = ssq_full)) +
  geom_boxplot()

ggplotly(plt)
=======
Code
fig3 = ggplot(data_by_age_group, aes(x = age_group, y = mean_ssq)) +
  geom_bar(stat = 'identity')



ggplotly(fig3)
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e
Code <<<<<<< HEAD
plt2 = ggplot(filteredData, aes(x = age_group, y = ssq_full)) +
  geom_boxplot()

ggplotly(plt2)
Code
library(tidyverse)

yex = filter(filteredData, VRexperience == "Yes")
nox = filter(filteredData, VRexperience == "No")

q1 = quantile(yex$age, probs = c(0.25), na.rm = TRUE) |> as.numeric()
q2 = quantile(nox$age, probs = c(0.25), na.rm = TRUE) |> as.numeric()
# https://forum.posit.co/t/make-the-r-function-quantile-return-a-numeric-value/178084
q3 = 2*q2-q1

ggplot(filteredData, aes(x = VRexperience, y = age)) + geom_boxplot() + geom_hline(yintercept = q1) + geom_hline(yintercept = q2) + geom_hline(yintercept = q3)
=======
library(tidyverse)

p = ggplot(filteredData, aes(x = age, y = ssq_full, colour = VRexperience)) +
  geom_point()

p
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e
<<<<<<< HEAD

Code
filteredData = mutate(filteredData, age_class = case_when(age > q3 ~ "older",
                                                      age > q2 ~ "old",
                                                      age > q1 ~ "young",
                                                      age > 0 ~ "younger"))

ggplot(filter(filteredData, age_class == "old" | age_class == "young"), aes(x = age_class, y = ssq_full)) + geom_boxplot()

=======

>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e
Code <<<<<<< HEAD
filteredData["age_group"] = cut(filteredData$age, c(16, 22, 30, 38, 46, Inf), c("16-21", "22-29", "30-37", "38-45", "45+"), include.lowest = TRUE)

ggplot(filteredData, aes(x = VRexperience, y = ssq_full, fill = VRexperience)) + stat_summary(fun = "mean", geom = "bar", position = "dodge")
=======
plt = ggplot(filteredData, aes(x = VRexperience, y = ssq_full, fill = VRexperience)) +
  geom_boxplot() +
  theme_minimal()

ggplotly(plt)
Code
plt2 = ggplot(filteredData, aes(x = age_group, y = ssq_full)) +
  geom_boxplot()

ggplotly(plt2)
Code
library(tidyverse)

yex = filter(filteredData, VRexperience == "Yes")
nox = filter(filteredData, VRexperience == "No")

q1 = quantile(yex$age, probs = c(0.25), na.rm = TRUE) |> as.numeric()
q2 = quantile(nox$age, probs = c(0.25), na.rm = TRUE) |> as.numeric()
# https://forum.posit.co/t/make-the-r-function-quantile-return-a-numeric-value/178084
q3 = 2*q2-q1

ggplot(filteredData, aes(x = VRexperience, y = age)) + geom_boxplot() + geom_hline(yintercept = q1) + geom_hline(yintercept = q2) + geom_hline(yintercept = q3)
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e

Code
filteredData = mutate(filteredData, age_class = case_when(age > q3 ~ "older",
                                                      age > q2 ~ "old",
                                                      age > q1 ~ "young",
                                                      age > 0 ~ "younger"))

ggplot(filter(filteredData, age_class == "old" | age_class == "young"), aes(x = age_class, y = ssq_full)) + geom_boxplot()

Code <<<<<<< HEAD
library(lubridate)

class(filteredData$Date[1])
=======
filteredData["age_group"] = cut(filteredData$age, c(16, 22, 30, 38, 46, Inf), c("16-21", "22-29", "30-37", "38-45", "45+"), include.lowest = TRUE)

ggplot(filteredData, aes(x = VRexperience, y = ssq_full, fill = VRexperience)) + stat_summary(fun = "mean", geom = "bar", position = "dodge")

Code
library(lubridate)

class(filteredData$Date[1])
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e
[1] "POSIXct" "POSIXt" 
Code <<<<<<< HEAD
d = filteredData$Date[1] |> as.POSIXct()
year(d) # used chatgpt for this because there is no known website in the universe that has this information for SOME REASON
=======
d = filteredData$Date[1] |> as.POSIXct()
year(d) # used chatgpt for this because there is no known website in the universe that has this information for SOME REASON
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e
[1] 2021
Code <<<<<<< HEAD
ggplot(filteredData, aes(x = generation, y = ssq_full)) + geom_boxplot()
=======
ggplot(filteredData, aes(x = generation, y = ssq_full)) + geom_boxplot()
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e

Code <<<<<<< HEAD
ggplot(filteredData, aes(x = age, y = ssq_full, color = generation)) + geom_point()
=======
ggplot(filteredData, aes(x = age, y = ssq_full, color = generation)) + geom_point()
>>>>>>> 588ba637ff93f216fa9b7b06208d476d01c0f75e

Code
ggplot(filteredData) +
  geom_boxplot(aes(x = "Discomfort", y = d_discomfort, fill = VRexperience)) +
  geom_boxplot(aes(x = "Fatigue", y = d_fatigue, fill = VRexperience)) +
  geom_boxplot(aes(x = "Headache", y = d_headache, fill = VRexperience)) +
  geom_boxplot(aes(x = "Eyestrain", y = d_eyestrain, fill = VRexperience)) +
  geom_boxplot(aes(x = "Difficulty Focusing", y = d_difficulty_focusing, fill = VRexperience)) +
  geom_boxplot(aes(x = "Salivation", y = d_salivation, fill = VRexperience)) +
  geom_boxplot(aes(x = "Sweating", y = d_sweating, fill = VRexperience)) +
  geom_boxplot(aes(x = "Nausea", y = d_nausea, fill = VRexperience)) +
  geom_boxplot(aes(x = "Difficulty Concentrating", y = d_difficulty_concentrating, fill = VRexperience)) +
  geom_boxplot(aes(x = "Fullness of Head", y = d_fullness_of_head, fill = VRexperience)) +
  geom_boxplot(aes(x = "Blurred Vision", y = d_blurred_vision, fill = VRexperience)) +
  geom_boxplot(aes(x = "Dizziness (o)", y = d_dizziness_o, fill = VRexperience)) +
  geom_boxplot(aes(x = "Dizziness (c)", y = d_dizziness_c, fill = VRexperience)) +
  geom_boxplot(aes(x = "Vertigo", y = d_vertigo, fill = VRexperience)) +
  geom_boxplot(aes(x = "Stomach Awareness", y = d_stomach_awareness, fill = VRexperience)) +
  theme_minimal() +
  labs(title = "VR Experience and Symptom Change",
       x = "Symptom",
       y = "Change in Severity") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

Code
filteredData = mutate(filteredData, age_group = case_when(age >= 38 ~ "38 to 45",
                                                          age >= 37 ~ "30 to 37",
                                                          age >= 22 ~ "22 to 29",
                                                          age >= 16 ~ "16 to 21"))

ggplot(filteredData, aes(x = age_group, y = ssq_full, fill = VRexperience)) + geom_boxplot()

Professional Standard of Report

Acknowledgements

References